<?php
require('config.php');

        $goods_id=$_REQUEST['goods_id'];
        $type=0;
        $user_id=0;
        $isGoodsContent=0;
        if(isset($_REQUEST['type'])) $type=$_REQUEST['type'];
        if(isset($_REQUEST['user_id'])) $user_id=$_REQUEST['user_id'];
        if(isset($_REQUEST['isGoodsContent'])) $isGoodsContent=$_REQUEST['isGoodsContent'];
		$sql="select * from `".$oto."_integral` where `goodsId`='".$goods_id."' LIMIT 1";
		$result=$db->query($sql);
		while($row=$result->fetch_assoc()){
			$jf_goods[]=$row;//将取得的所有数据赋值给person_info数组
		}
		if(isset($jf_goods))
		{
			$data[0]['goodsName']=$jf_goods[0]['goodsName'];
			if($isGoodsContent==0) $data[0]['goodsContent']=htmlspecialchars_decode($jf_goods[0]['goodsContent']);
			$data[0]['goodsImg']=$jf_goods[0]['goodsImg'];
			$data[0]['marketPrice']=$jf_goods[0]['marketPrice'];
			
			if($type==1 || $type=='1')
			{
				$data[0]['shopPrice']=$jf_goods[0]['luckyPrice'];
				//$data[0]['goodsStock']=$jf_goods[0]['winningNum']-$jf_goods[0]['getLucky'];
				$data[0]['goodsStock']=$jf_goods[0]['goodsStock'];
			} 
			else
			{
				$data[0]['shopPrice']=$jf_goods[0]['shopPrice'];
				$data[0]['goodsStock']=$jf_goods[0]['goodsStock'];
			} 
			if($user_id==0 || $user_id=='0');
			else
			{
				$sql="select * from `".$oto."_users` where `userId`='".$user_id."' LIMIT 1";
				$result=$db->query($sql);
				while($row=$result->fetch_assoc()){
					$users_info[]=$row;//将取得的所有数据赋值给person_info数组
				}
				if(isset($users_info)) $data[0]['user_score']=$users_info[0]['userScore'];
				else $data[0]['user_score']="0";
			}
			$data[0]['goodsId']=$goods_id;
		}
		echo json_encode($data);
?>